#ifndef EYAS_CORE_THREAD_SCOPETHREAD_H_
#define EYAS_CORE_THREAD_SCOPETHREAD_H_

#include <boost/thread/thread.hpp>
#include "conf/def.h"

namespace eyas {
namespace thread {

class EYAS_THREAD_API scoped_thread {
public:
	template<typename F, typename... Args>
	scoped_thread(F f, Args... args)
		: thread_(f, args...) {
	}
	virtual ~scoped_thread() {
		thread_.join();
	}

private:
	boost::thread thread_;
};

}
}

#endif
